import * as types from '../actionTypes'
// counter 的 reducer
const reducer = (state = 0, action) => {
  console.log('counter reducer')
  switch (action.type) {
    case types.INCREMENT:
      return state + action.payload;
    case types.DECREMENT:
      return state - action.payload;
    default:
      return state;
  }
};

export default reducer